import React, { Component } from 'react'
import { Form, Input, Button, Checkbox } from 'antd';

const layout = {
    labelCol: {
        span: 8,
    },
    wrapperCol: {
        span: 16,
    },
};
const tailLayout = {
    wrapperCol: {
        offset: 8,
        span: 16,
    },
};


export class Create extends Component {
    onFinish = (values: any) => {
        console.log('Success:', values);
    };
    onFinishFailed = (errorInfo: any) => {
        console.log('Failed:', errorInfo);
    };
    render() {
        return (
            <div className="create-page wrap">
                <h3>创建</h3>
                <Form
                    {...layout}
                    name="basic" 
                    initialValues={{
                        remember: true,
                    }}
                    onFinish={this.onFinish}
                    onFinishFailed={this.onFinishFailed}
                >
                    <Form.Item
                        label="标题"
                        name="title"
                        rules={[
                            {
                                required: true,
                                message: '请输入您的标题',
                            },
                        ]}
                    >
                        <Input />
                    </Form.Item>

                    <Form.Item
                        label="描述"
                        name="con"
                        rules={[
                            {
                                required: true,
                                message: '请输入你的描述!',
                            },
                        ]}
                    >
                        <Input />
                    </Form.Item>

                    <Form.Item {...tailLayout}>
                        <Button >
                            完成
        </Button>
                    </Form.Item>
                </Form>
            </div>
        )
    }
}

export default Create
